package com.sailing.lianxi.inner;
/**
 * 匿名内部类2-继承普通类
 * @author Administrator
 *
 */

 class Bird{
	 private String name;
	 public Bird(String name) {
		 this.name =name;
	 }
  public void eat() {
	  System.out.println("father eat");
  }
}

public class AnonymousInnerDemo2 {
	public static void main(String[] args) {
		Bird bird = new Bird("11") {
			public void eat() {
				System.out.println("匿名内部类");
			}
		};
		bird.eat();
	}
}




